#!/usr/bin/env python
# _*_coding:utf-8_*_

"""
@author:gao
@file: testDemo.py
@time: 2018/09/{DAY}
"""

import sys
# import os
import pathlib


def app_path():
    """Returns the base application path."""
    if hasattr(sys, 'frozen'):
        # Handles PyInstaller
        return pathlib.PurePath(sys.executable).parent
        # return os.path.dirname(sys.executable)  # 使用pyinstaller打包后的exe目录
    # return os.path.dirname(__file__)  # 没打包前的py目录
    return pathlib.PurePath(__file__).parent  # 没打包前的py目录
